package com.sky.mapper;

import com.sky.dto.SetmealDTO;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 根据菜品id查询对应的套餐id
     */
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);


    /**
     * 向口味表里插入数据
     * @param dish
     */
    void insertBatch(List<SetmealDish> dish);

    /**
     * 根据套餐id删除对应的菜品数据
     * @param
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmeal_id}")
    void deleteBySetmealId(Long setmeal_id);

    /**
     * 根据套餐id查询对应的菜品
     * @param setmeal_id
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setmeal_id}")
    List<SetmealDish> getBySetmealId(Long setmeal_id);
}
